# Maintainer:
pkgname=py3-memory-tempfile
pkgver=2.2.3
pkgrel=4
pkgdesc="Create temporary files and temporary dirs in memory-based filesystems on Linux"
url="https://github.com/mbello/memory-tempfile"
arch="noarch"
license="MIT"
depends="python3"
makedepends="py3-gpep517 py3-poetry-core"
subpackages="$pkgname-pyc"
source="$pkgname-$pkgver.tar.gz::https://github.com/mbello/memory-tempfile/archive/refs/tags/v$pkgver.tar.gz
	poetry-core.patch
	"
builddir="$srcdir/memory-tempfile-$pkgver"
# can't find a tmpdir even when there is one on builders, works locally
options="$options !check"

build() {
	gpep517 build-wheel \
		--wheel-dir .dist \
		--output-fd 3 3>&1 >&2
}

check() {
	PYTHONPATH="$PWD" \
	python3 tests/test_*.py
}

package() {
	python3 -m installer -d "$pkgdir" \
		.dist/memory*.whl
}

sha512sums="
773db9a6ffca7f01187fdaaa0fdab0ece6f04720ffdb8d4b2c7a2b20394ca5d8b2a797c0f3611d711e97e5e0703e03e728fc910c1380148aa53dd0c95aab1cbf  py3-memory-tempfile-2.2.3.tar.gz
11c5868be27dc67a00e451bf489df4f1bcb0807a368a184293eb205c9af86355efcb0df5d69a8f9a48e9e35d36b21b39e86cccf8b0e68467cf66ca90ebcd339d  poetry-core.patch
"
